package ar.edu.unq.wannaplay.services;

import java.io.Serializable;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import ar.edu.unq.wannaplay.client.Client;
import ar.edu.unq.wannaplay.persistence.daos.FakeClientDAO;

public class FakeClientService implements Serializable {
    private static final long serialVersionUID = 1L;

    private FakeClientDAO dao;

    @Transactional(readOnly = true)
    public void saveClient(final String name, final String email, final String address, final String town) {
        this.getDao().save(new Client(name, email, address, town));
    }

    @Transactional
    public List<Client> findAllClients() {
        return this.getDao().findAll();
    }

    public FakeClientDAO getDao() {
        return dao;
    }

    public void setDao(final FakeClientDAO dao) {
        this.dao = dao;
    }
}
